<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div style="height: 300vh"></div>
<script>
  /*
    chrome 92.0.4515.131 下会在最后多滚动一次
    滚动的目标位置为0(即强制回到了顶部)

    在线沙盒和firefox都没这毛病
    https://jsbin.com/bugenonove/edit?html,console,output
  */
  window.addEventListener('scroll',()=>{
    console.log('document.documentElement.scrollTop):',document.documentElement.scrollTop);
    console.log('滚动了一次');
  })

  document.documentElement.scrollTop = 100;
  setTimeout(()=>{
    document.documentElement.scrollTop = 200;
  })
</script>
</body>
</html>
